Field of the Invention
The present invention relates to an image processing apparatus, a distance detection apparatus, a focusing apparatus, an image capturing apparatus, an image processing method, and a non-transitory computer-readable storage medium.
Description of the Related Art
A conventional camera configured to detect a focusing state using a phase difference detection method cannot precisely detect the focusing state when there are two objects (main object and background) having different object distances in a focus detection area, due to a so-called perspective conflict in which these objects are simultaneously evaluated. Japanese Patent Laid-Open No. (“JP”) 2013-257512 discloses a method for classifying pixels into a pixel that is close to an in-focus state and a pixel that is not, and for calculating each correlation. JP 2015-102735 discloses a method for classifying areas into an area close to an in-focus state and an area distant from the in-focus state, and for calculating each correlation.
Since JPs 2013-257512 and 2015-102735 separate both objects from each other using a principle in which when one of the long distance object and the short distance object has a high correlation, the other has a low correlation, the prior art require a sufficient distance between both objects. In other words, it is necessary to initially find a condition that provides a high correlation of the phase difference for one of the objects. When both objects are too close to each other, the correlation of the phase difference is high in a middle position between both the objects, and even the perspective conflict cannot be detected.